package com.ctsims.system.service.impl;

import java.util.List;
import com.ctsims.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ctsims.system.mapper.CtsScoresMapper;
import com.ctsims.system.domain.CtsScores;
import com.ctsims.system.service.ICtsScoresService;

/**
 * 课程成绩Service业务层处理
 *
 * @author hhz
 * @date 2023-04-01
 */
@Service
public class CtsScoresServiceImpl implements ICtsScoresService
{
    @Autowired
    private CtsScoresMapper ctsScoresMapper;

    /**
     * 查询课程成绩
     *
     * @param id 课程成绩主键
     * @return 课程成绩
     */
    @Override
    public CtsScores selectCtsScoresById(Long id)
    {
        return ctsScoresMapper.selectCtsScoresById(id);
    }

    /**
     * 查询课程成绩列表
     *
     * @param ctsScores 课程成绩
     * @return 课程成绩
     */
    @Override
    public List<CtsScores> selectCtsScoresList(CtsScores ctsScores)
    {
        return ctsScoresMapper.selectCtsScoresList(ctsScores);
    }

    /**
     * 新增课程成绩
     *
     * @param ctsScores 课程成绩
     * @return 结果
     */
    @Override
    public int insertCtsScores(CtsScores ctsScores)
    {
        ctsScores.setCreateTime(DateUtils.getNowDate());
        return ctsScoresMapper.insertCtsScores(ctsScores);
    }

    /**
     * 修改课程成绩
     *
     * @param ctsScores 课程成绩
     * @return 结果
     */
    @Override
    public int updateCtsScores(CtsScores ctsScores)
    {
        ctsScores.setUpdateTime(DateUtils.getNowDate());
        return ctsScoresMapper.updateCtsScores(ctsScores);
    }

    /**
     * 批量删除课程成绩
     *
     * @param ids 需要删除的课程成绩主键
     * @return 结果
     */
    @Override
    public int deleteCtsScoresByIds(Long[] ids)
    {
        return ctsScoresMapper.deleteCtsScoresByIds(ids);
    }

    /**
     * 删除课程成绩信息
     *
     * @param id 课程成绩主键
     * @return 结果
     */
    @Override
    public int deleteCtsScoresById(Long id)
    {
        return ctsScoresMapper.deleteCtsScoresById(id);
    }
}
